﻿@{
    ViewBag.Title = "组织架构";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript" src="/Scripts/m-lhgdialog/m-lhgdialog.js"></script>    
<script type="text/javascript" src="/Scripts/library/m-pagination.js"></script>    

<form id="form1" runat="server">
<div class="path">
        <strong>部门管理</strong>
    </div>
    <div class="pd10">
        <div class="mb10 aL">
            <a href="/Organization/Edit" title="添加部门" class="i-btn1" >添加部门</a>
        </div>
          <span id="Grid">
<table class="tb-data">
<thead>
    <tr>
        <th>
            部门ID
        </th>
        <th>
            部门名称
        </th>
        <th>
            部门主管ID
        </th>
        <th >
            部门主管姓名
        </th>
         <th >
            部门号码
        </th>
         <th >
            部门地址
        </th>
         <th  style=" width:20%">
            操作
        </th>
    </tr>
	 </thead>
	 <tbody>
    @foreach (var item in ViewData["OrganizationList"] as List<OrganizationModel>)
    {
     <tr>
        <td >
           @item.OrgID
        </td>
          <td class="aL">
           @item.OrgName
        </td>         
        <td >
           @item.LeaderID
        </td>
         <td >
           @item.LeaderName
        </td>
         <td >
           @item.OfficePhone 
        </td>
         <td >
           @item.Address
        </td>
        <td style="width:20%">
          <a href="javascript:void(showEdit('@item.OrgID'))">编辑</a>  <a href="javascript:void(showAdd('@item.OrgID'))">添加部门</a> <a href="/AdminGroup/Index?orgID=@item.OrgID">管理职位</a> <a href="javascript:;" onclick="DeleteNews('@item.OrgID')">删除</a>
        </td>
    </tr>
    }
	 </tbody>
</table>
        </span>
    </div>
    </form>

<script type="text/javascript">
	 	function showEdit(orgID) {
	 		OpenPop('/Organization/edit?action=2&orgID=' + orgID, "编辑商品类目", 600, 350);
	 	};

	 	function showAdd(orgID) {
	 		OpenPop('/Organization/edit?action=1&orgID=' + orgID, "添加部门", 600, 350);
	 	};

	 	//打开弹窗
	 	function OpenPop(url, titleName, width, height) {
	 		width = width || 800;
	 		height = height || 500;
	 		window.top.winObj = window;
	 		window.top.oDG = new $.dialog({ id: 'esDialog', title: titleName, page: url, width: width, height: height, btnBar: false, lockScroll: true });
	 		window.top.oDG.ShowDialog();
	 	}
</script>

